package com.test.kotlin06

data class Studen(
    var _name:String,
    val age:Int
) {

    var name = _name
    var score = 10
    private val hobby = "music"
//    val subject:String

    init{
        println("initializating student")
    }

    constructor(_name: String):this(_name,10){
        score =100
    }


}

fun main() {
    val s = Studen("Jack")
    val copy = s.copy("Rose")//拷贝

    println(s)
    println(copy)

}